function e(e) {
    return new Promise(function(n) {
        var t = getCurrentPages(), o = t[t.length - 1];
        if ("wx" === getApp().platform) {
            var r = o.selectComponent(e);
            if (!r) return console.error("无法找到对应的组件，请按文档说明使用组件"), null;
            n(r);
        }
        "my" === getApp().platform && o.$getComponentBy(function(t) {
            if (t.props.id === e.substring(1)) return n(t);
        });
    });
}

function n(n) {
    var t = n.selector;
    e(void 0 === t ? "#toast" : t).then(function(e) {
        e.handleShow(n);
    });
}

n.hide = function() {
    var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "#toast";
    e(n);
    e(n).then(function(e) {
        e.handleHide();
    });
}, module.exports = {
    $Toast: n,
    $Message: function(n) {
        var t = n.selector;
        e(void 0 === t ? "#message" : t).then(function(e) {
            e.handleShow(n);
        });
    }
};